<?php

use Illuminate\Foundation\Inspiring;

/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/

Artisan::command('inspire', function () {
    $this->comment(now()->endOfDay());
})->describe('Display an inspiring quote');


Artisan::command('echo-socket', function () {
   $userModel = \App\Models\SyUser::find(126);
   broadcast(new \App\Events\NewWarn($userModel));
   broadcast(new \App\Events\ExampleEvent);
})->describe('echo broadcast');

Artisan::command('test-event', function () {
   broadcast(new \App\Events\ExampleEvent);
})->describe('echo test broadcast');


Artisan::command('login-event', function () {
   $user = \App\Models\SyUser::find(166);
   broadcast(new \App\Events\LoginEvent($user));
})->describe('echo login event');
    
Artisan::command('hour-show', function () {
    $this->comment(date('Y-m-d H', strtotime('2019-12-04 15:00:00')));
    $this->comment(date('H', strtotime('2019-12-04 00:00:00')));
    dd(randomFloat(2,5));
})->describe('Display an inspiring quote');


Artisan::command('login-event-p {userid}', function ($userid) {
   $user = \App\Models\SyUser::find($userid);
   broadcast(new \App\Events\PresenceBroadcastEvent($user));
})->describe('echo login event');